package com.shop.service;

import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

/**
 * @BelongsProject: shop
 * @BelongsPackage: com.shop.service
 * @Author: GaoDo
 * @CreateTime: 2020-11-28 16:54
 * @Description: 线程池实现类
 */
@Slf4j
@Service
public class AsyncServiceImpl implements AsyncService{
    @Override
    @Async("asyncServiceExecutor")
    public void executeAsync() {
        log.info("start executeAsync");

        System.out.println("异步线程要做的事情");
        System.out.println("可以在这里执行批量插入等耗时的事情");

        log.info("end executeAsync");
    }
}
